package com.yt.al.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigUtil {

	public static String getProperties(String key)
	{
		String value = "";
		File classpathRoot = new File(System.getProperty("user.dir"));
		File appDir = new File(classpathRoot, "config");
		File app = new File(appDir, "base.properties");
		InputStream inputStream;
		try {
			inputStream = new FileInputStream(app);
			Properties p = new Properties();   
			  try {   
			   p.load(inputStream);   
			   value = p.getProperty(key, "");
			  } catch (IOException e1) {   
			   e1.printStackTrace();   
			  }   
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}   
		  
		return value;
	}
}
